package com.eflow.engine.service;

import org.flowable.bpmn.model.Activity;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.EndEvent;
import org.flowable.bpmn.model.FlowNode;
import org.flowable.engine.repository.ProcessDefinition;

import java.util.List;

/**
 * @CLASSNAME IEflowBpmModeService
 * @Description
 * @Auther JanHezz
 * @BLOG www.luckyhe.com
 * @DATE 2021/3/4 10:32
 */
public interface IEflowRepositoryServiceService {

    /**
     * 通过processDefId获得流程模型对象
     * @param processDefId 流程定义ID
     * @return
     */
    public BpmnModel getBpmnModelByProcessDefId(String processDefId);


    /**
     * 根据流程定义ID获取流程定义信息
     * @param processDefId
     * @return
     */
     public ProcessDefinition getProcessDefinitionByProcessDefId(String processDefId);

    /**
     * 通过processDefId获得所有流程节点
     * @param processDefId 流程定义ID
     * @return
     */
     public List<FlowNode> findFlowNodes(String processDefId);


    /**
     * 通过processDefId获得所有结束节点
     * @param processDefId 流程定义ID
     * @return
     */
      public List<EndEvent> findEndFlowElement(String processDefId);


    /**
     * 根据节点id获得节点信息
     * @param processDefId 流程定义ID
     * @param activityId 节点ID
     * @Param isMain  是否主流程
     * @return
     */
    public FlowNode findFlowNodeByActivityId(String processDefId, String activityId,Boolean isMain);


    /**
     * 判断该节点ID是否存在该流程图中
     * @param processDefId 流程定义ID
     * @param activityId 节点ID
     * @return
     */
      public boolean checkActivitySubprocessByActivityId(String processDefId, String activityId);

    /**
     * 根据节点名称获得节点信息
     * @param processDefId
     * @param name
     * @return
     */
      public FlowNode findFlowNodeByName(String processDefId, String name);
}
